package app.common.dao;
import java.util.ArrayList;
import java.util.List;
import cn.lily.com.container.data.Record;
import cn.lily.com.exception.YaconException;
import cn.lily.esb.framework.drivers.db.bean.ControlDAO;
public class Leo_galcan_nameBean extends ControlDAO implements Cloneable {
	private static final long serialVersionUID = 1L;
	public Leo_galcan_nameBean() throws YaconException {
		super();
		setTableName("LEO_GALCAN_NAME");
	}
	String  fcan_name_id;
	String  fcan_id;
	String  fcan_name_fix;
	String  fcan_create_time;
	String  fcan_create_oper;

	public void setCan_name_id( String can_name_id)throws YaconException{
		setFieldData("can_name_id",can_name_id,TEXT);
		this.fcan_name_id=can_name_id;
	}

	public String getCan_name_id(){
		if ( this.fcan_name_id == null){
			return "";
		}
		else {
			return this.fcan_name_id;
		}
	}

	public void setCan_id( String can_id)throws YaconException{
		setFieldData("can_id",can_id,TEXT);
		this.fcan_id=can_id;
	}

	public String getCan_id(){
		if ( this.fcan_id == null){
			return "";
		}
		else {
			return this.fcan_id;
		}
	}

	public void setCan_name_fix( String can_name_fix)throws YaconException{
		setFieldData("can_name_fix",can_name_fix,TEXT);
		this.fcan_name_fix=can_name_fix;
	}

	public String getCan_name_fix(){
		if ( this.fcan_name_fix == null){
			return "";
		}
		else {
			return this.fcan_name_fix;
		}
	}

	public void setCan_create_time( String can_create_time)throws YaconException{
		setFieldData("can_create_time",can_create_time,DATE);
		this.fcan_create_time=can_create_time;
	}

	public String getCan_create_time(){
		if ( this.fcan_create_time == null){
			return "";
		}
		else {
			return this.fcan_create_time;
		}
	}

	public void setCan_create_oper( String can_create_oper)throws YaconException{
		setFieldData("can_create_oper",can_create_oper,TEXT);
		this.fcan_create_oper=can_create_oper;
	}

	public String getCan_create_oper(){
		if ( this.fcan_create_oper == null){
			return "";
		}
		else {
			return this.fcan_create_oper;
		}
	}

	public  List<Leo_galcan_nameBean> findListBeans(String sSqlWhere)throws YaconException {
		List<Leo_galcan_nameBean> listBeans = new ArrayList<Leo_galcan_nameBean>();
		findTable = findTableByWhere(sSqlWhere);
		while (findTable.next())
		{
			Leo_galcan_nameBean fDaoBean  = new Leo_galcan_nameBean();
			fDaoBean.fcan_name_id = findTable.getString("can_name_id");
			fDaoBean.fcan_id = findTable.getString("can_id");
			fDaoBean.fcan_name_fix = findTable.getString("can_name_fix");
			fDaoBean.fcan_create_time = findTable.getString("can_create_time");
			fDaoBean.fcan_create_oper = findTable.getString("can_create_oper");
			fDaoBean.operate_mode = "edit";
			listBeans.add(fDaoBean);
		}
		return listBeans;
	}

	public Leo_galcan_nameBean findBean(String sSqlWhere)throws YaconException {
		findTable = findTableByWhere(sSqlWhere);
		if (findTable.next())
		{
			Leo_galcan_nameBean fDaoBean  = new Leo_galcan_nameBean();
			fDaoBean.fcan_name_id = findTable.getString("can_name_id");
			fDaoBean.fcan_id = findTable.getString("can_id");
			fDaoBean.fcan_name_fix = findTable.getString("can_name_fix");
			fDaoBean.fcan_create_time = findTable.getString("can_create_time");
			fDaoBean.fcan_create_oper = findTable.getString("can_create_oper");
			fDaoBean.operate_mode = "edit";
			return fDaoBean;
		}else
			return null;
	}

	public void setViewRecord(Record viewRecord) throws YaconException{
		if (viewRecord.getString("can_name_id") != null)
			setCan_name_id(viewRecord.getString("can_name_id"));
		if (viewRecord.getString("can_id") != null)
			setCan_id(viewRecord.getString("can_id"));
		if (viewRecord.getString("can_name_fix") != null)
			setCan_name_fix(viewRecord.getString("can_name_fix"));
		if (viewRecord.getString("can_create_time") != null)
			setCan_create_time(viewRecord.getString("can_create_time"));
		if (viewRecord.getString("can_create_oper") != null)
			setCan_create_oper(viewRecord.getString("can_create_oper"));
	}

}
